package com.lct.string;

public class StringDemo3 {
    public static void main(String[] args) {
        // 目标：理解String的对象是不可变的。
        String name = "黑马";
        name += "程序员";
        name += "播妞";
        System.out.println(name);

        String s1 = "abc";
        String s2 = "ab";
        String s3 = s2 + "c";
        System.out.println(s1 ==  s3); // false

        String t1 = "abc";
        String t2 = "a" + "b" + "c";
        System.out.println(t1 == t2); // true
    }
}
